package com.ls.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 电话黑名单
 * </p>
 *
 * @author pengyu
 * @since 2024-10-12
 */
@NoArgsConstructor
@Data
@EqualsAndHashCode(callSuper = false)
public class BlackList extends Model<BlackList> {

    private static final long serialVersionUID=1L;

    /**
     * 自增主键
     */
    @TableId(value = "black_id", type = IdType.AUTO)
    private Long blackId;

    /**
     * 客户主键
     */
    private Long customerId;

    /**
     * 客户电话，外键
     */
    private String customerPhone;

    /**
     * 黑名单，只能是手机号码
     */
    private String blackPhone;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public BlackList(String blackPhone, Long customerId, String customerPhone) {
        this.blackPhone = blackPhone;
        this.customerId = customerId;
        this.customerPhone = customerPhone;
        this.createTime = LocalDateTime.now();
    }

    @Override
    protected Serializable pkVal() {
        return this.blackId;
    }

}
